import Vue from 'vue'
import { Button, Tabbar, TabItem, Field, Toast, Header, Navbar, Lazyload, Popup, Swipe, SwipeItem } from 'mint-ui'

Vue.component(Field.name, Field)
Vue.component(Button.name, Button)
Vue.component(Tabbar.name, Tabbar)
Vue.component(TabItem.name, TabItem)
Vue.component(Header.name, Header)
Vue.component(Navbar.name, Navbar)
Vue.component(Popup.name, Popup)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)

Vue.use(Lazyload)
Vue.prototype.$toast = (message = '提示', position = 'bottom', duration = 2000) => {
  return Toast({
    message,
    position,
    duration
  })
}
